package router

import (
	"fmt"
	"net/http"

	"github.com/gin-gonic/gin"
)

func InitUploadRouter(router *gin.Engine) {
	router.LoadHTMLFiles(fmt.Sprintf("oss-web/templates/index.html"))
	// 配置静态文件夹路径 第一个参数是api，第二个是文件夹路径
	router.StaticFS("/static", http.Dir(fmt.Sprintf("oss-web/static")))

	router.GET("", func(c *gin.Context) {
		c.HTML(http.StatusOK, "index.html", gin.H{
			"title": "posts/index",
		})
	})
}
